﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using log4net;
using HTTT.Utilities;

namespace HTTT.admin
{
    public partial class AdminIndex : System.Web.UI.Page
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(_Default).Name);
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckPermission();
            log.Error("Go to administrator page");
        }

        private void CheckPermission()
        {
            if (!Page.User.IsInRole(Constants.ROLE_SUPER_ADMINISTRATOR)
                 && !Page.User.IsInRole(Constants.ROLE_ADMINISTRATOR))
            {
                Response.Redirect("/admin/AccessDenied.aspx");
            }
        }
    }
}